package com.brzjomo.secretiveworld.inventory.slot;

import com.brzjomo.secretiveworld.init.ModBlocks;

import net.minecraft.block.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class GreedyChestSlot extends Slot {

	public GreedyChestSlot(IInventory inventoryIn, int index, int xPosition, int yPosition) {
		super(inventoryIn, index, xPosition, yPosition);
	}

	@SuppressWarnings("deprecation")
	@Override
	public boolean isItemValid(ItemStack stack) {
		boolean isBanned = stack.getItem() == Item.getItemFromBlock(Blocks.SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.BLACK_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.BLUE_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.BROWN_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.CYAN_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.GRAY_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.GREEN_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.LIGHT_BLUE_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.LIGHT_GRAY_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.LIME_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.MAGENTA_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.ORANGE_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.PINK_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.PURPLE_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.RED_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.WHITE_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.YELLOW_SHULKER_BOX)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.CHEST)
				|| stack.getItem() == Item.getItemFromBlock(Blocks.ENDER_CHEST)
				|| stack.getItem() == Item.getItemFromBlock(ModBlocks.GREEDY_CHEST.get());

		if (isBanned) {
			return false;
		} else {
			return true;
		}
	}
}
